home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1997 February / PC Plus Super CD (Issue 124) (PCP124-2-97) (February 1997).iso / handson / vbwkshp / global.bas < prev    next >
Encoding:
BASIC Source File  |  1996-11-07  |  1.7 KB  |  56 lines

  1. Attribute VB_Name = "Module1"
  2. 'Public variables for multi play choices
  3. Public StartWhere As Integer
  4. Public StartNumber As Integer
  5. Public StartName As String
  6. Public Cancelled As Integer
  7. Public FileMark As Integer
  8. Public i As Integer, y As Integer
  9.  
  10. 'Other public variables
  11. Public FavouritesPath As String
  12. Public DialogCaption As String
  13.  
  14. ' Public Constants
  15. Public Const MCIAppTitle = "MIDI CYCLOTRON "
  16.  
  17. ' These constants are defined in mmsystem.h.
  18. Public Const MCIErrInvalidDeviceID = 30257
  19. Public Const MCIErrDeviceOpen = 30263
  20. Public Const MCIErrCannotLoadDriver = 30266
  21. Public Const MCIErrUnsupportedFunction = 30274
  22. Public Const MCIErrInvalidFile = 30304
  23.  
  24. 'API Declares to determine drive type (See MCIApp Form_Load event)
  25. 'If 32bit then,
  26. #If Win32 Then
  27.     Public Declare Function GetDriveType _
  28.     Lib "kernel32" Alias "GetDriveTypeA" ( _
  29.     ByVal cDrive As String) As Long
  30. 'Otherwise, if 16bit then,
  31. #Else
  32.     Public Declare Function GetDriveType _
  33.     Lib "Kernel" (ByVal nDrive As Integer) As Integer
  34. #End If
  35.  
  36. ' Force all run-time errors to be handled here.
  37. Sub DisplayErrorMessageBox()
  38.     Dim Msg As String
  39.     Select Case Err
  40.         Case MCIErrCannotLoadDriver
  41.             Msg = "Error load media device driver."
  42.         Case MCIErrDeviceOpen
  43.             Msg = "The device is not open or is not known."
  44.         Case MCIErrInvalidDeviceID
  45.             Msg = "Invalid device id."
  46.         Case MCIErrInvalidFile
  47.             Msg = "Invalid filename."
  48.         Case MCIErrUnsupportedFunction
  49.             Msg = "Action not available for this device."
  50.         Case Else
  51.             Msg = "Unknown error (" + Str$(Err) + ")."
  52.     End Select
  53.  
  54.     MsgBox Msg, 48, MCIAppTitle
  55. End Sub
  56.